package Tank51;

import java.awt.*;

public class Bomb implements GameObject{
    private int x;
    private int y;
    private int count = 0;
    private boolean life = true;
    static Image[] imagesBomb = new Image[43];

    public Bomb(int x,int y){
        this.x = x;
        this.y = y;
    }


    static {
        for(int i = 0;i < imagesBomb.length;i++){
            imagesBomb[i] = Toolkit.getDefaultToolkit().getImage("src\\images\\b"+(i + 1)+".gif");
        }
    }

    @Override
    public void paint(Graphics g) {
        g.drawImage(imagesBomb[count],x,y,null);
        count++;
        if(count >= 42){
            this.life = false;
        }
    }

    public boolean getLife(){
        return life;
    }
    public void setLife(boolean life){
        this.life = life;
    }
}
